<template>
	<div class="theme">
		<van-nav-bar title="详情页" left-arrow @click-left="$router.back(-1)"></van-nav-bar>
		<div class="overlay headTop">
			<div class="overlay-content scrolling">
				<div>
					<van-cell-group v-for="(el,i) in list" :key="i">
						<van-cell title="提供者uuid" :value="el.incomeUuid"></van-cell>
						<van-cell title="业绩" :value="parseFloat(el.amount).toFixed(5).slice(0,-1)"></van-cell>
						<van-cell title="收益值" :value="parseFloat(el.rewardBase).toFixed(5).slice(0,-1)"></van-cell>
						<van-cell title="收益" :value="parseFloat(el.reward).toFixed(5).slice(0,-1)"></van-cell>
						<van-cell title="日期">
							{{el.createTime | formatDate}}
						</van-cell>
					</van-cell-group>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	let _this;
	import { base } from './../utils/api';
	import { formatDate } from './../utils/date';
	export default {
		name: 'billDetails',
		components: {},
		props: {},
		data() {
			return {
				list: [],
			};
		},
		beforeCreate() {
			_this = this;
		},
		watch: {},
		computed: {},
		methods: {
			getList() {
				base.getShareRewardDetail({
					incomeUuid: this.$route.params.incomeUuid,
					createTime: this.$route.params.createTime
				}).then(res => {
					if(res.code == 200) {
						this.list = res.data;
					}
				})
			},
			formatLevelId(id) {
				switch(Number(id)) {
					case 1:
						return '普通'
						break;
					case 2:
						return '银钻'
						break;
					case 3:
						return '金钻'
						break;
					case 4:
						return '蓝钻'
						break;
					case 5:
						return '黑钻'
						break;
				}
			},
		},
		created() {},
		mounted() {
			this.getList();
		},
		destroyed() {

		},
		filters: {
			formatDate(time) {
				let date = new Date(time);
				return formatDate(date, 'yyyy-MM-dd hh:mm:ss');
			}
		}
	};
</script>

<style lang="less" scoped>
	.overlay-content {
		background: #f5f5f5;
		padding: 15px 10px;
		.van-cell-group {
			border-radius: 5px !important;
		}
		.van-cell {
			border-radius: 5px;
		}
	}
	
	.van-cell:not(:last-child)::after {
		left: 0;
	}
	
	.van-cell-group{
		margin-bottom: 10px;
	}
	
	/deep/ .van-nav-bar {
		background-color: #43add5;
	}
	
	/deep/ .van-nav-bar .van-icon {
		color: white;
	}
	
	/deep/ .van-nav-bar__title {
		color: white;
	}
	
	/deep/ .van-nav-bar__arrow {
		font-size: 18px;
	}
</style>